<?php
namespace app\backstage\controller;
use think\Controller;
use think\facade\Request;

class Log extends Controller
{
    protected $middleware = [
        'VerifyJwt' => ['except' => []],
        'VerifyPower' => ['except' => []],
    ];

    /*日志列表*/
    public function index()
    {
        return $this->fetch();
    }

    /*日志列表数据*/
    public function list_data()
    {
        $params = Request::param('', '', 'strip_tags');
        $Log = \think\facade\App::model('Log', 'logic');
        $result = $Log->getList($params);

        if ($result['count'] > 0) {
            return ['code' => 0, 'msg' => '数据获取成功', 'count' => $result['count'], 'data' => $result['list']];
        }

        return ['code' => 1, 'msg' => '暂无数据', 'count' => $result['count'], 'data' => $result['list']];
    }

}